#pragma once
#include "DXAMLCommon.h"
#include "IXamlSchemaObject.h"
#include "XamlProperty.h"
#include "XamlText.h"

#include "XamlLineInfo.h"


class XamlScannerNode
{
public: 
	enum ScannerNodeType
	{
		sntNone = 0x0,
		sntElement = 0x1,
		sntEmptyElement = 0x2,
		sntAttribute = 0x3,
		sntDirective = 0x4,
		sntPrefixDefinition = 0x5,
		sntPropertyElement = 0x6,
		sntText = 0x7,
		sntEndTag = 0x8,
		sntNumberOfScannerNodeTypes = 0x9
	};


	XamlScannerNode(const XamlLineInfo & __that);
	XamlScannerNode();
	~XamlScannerNode();
	void InitEndTag(const XamlLineInfo & inLineInfo, XBOOL bIsFromEmpty);
	void InitPropertyElement(const XamlLineInfo & inLineInfo, const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlNamespace> & inNamespace, const xshared_ptr<XamlProperty> & inProperty, XBOOL bIsFromEmpty);
	void InitText(const XamlLineInfo & inLineInfo, const xshared_ptr<XamlText> & inText);
	void InitPrefixDefinition(const XamlLineInfo & inLineInfo, const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlNamespace> & inNamespace, const xshared_ptr<XamlText> & inAttributeText);
	void InitDirective(const XamlLineInfo & inLineInfo, const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlProperty> & inPropertyAttribute, const xshared_ptr<XamlText> & inAttributeText);
	void InitAttribute(const XamlLineInfo & inLineInfo, const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlProperty> & inPropertyAttribute, const xshared_ptr<XamlText> & inAttributeText);
	void InitElement(const XamlLineInfo & inLineInfo, const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlNamespace> & inNamespace, const xshared_ptr<XamlType> & inType);
	void InitEmptyElement(const XamlLineInfo & inLineInfo, const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlNamespace> & inNamespace, const xshared_ptr<XamlType> & inType);
	const enum XamlScannerNode::ScannerNodeType & get_NodeType() const;
	const xshared_ptr<XamlType> & get_Type() const;
	const xshared_ptr<XamlNamespace> & get_TypeNamespace() const;
	const xshared_ptr<XamlProperty> & get_PropertyAttribute() const;
	const xshared_ptr<XamlText> & get_PropertyAttributeText() const;
	const xshared_ptr<XamlProperty> & get_PropertyElement() const;
	const XBOOL & get_IsEmptyTag();
	const xshared_ptr<XamlText> & get_TextContent() const;
	const xshared_ptr<CXString> & get_Prefix() const;
	const XamlLineInfo & get_LineInfo() const;
private: 
	xshared_ptr<IXamlSchemaObject> m_spTypeOrProperty;
	xshared_ptr<XamlText> m_spText;
	xshared_ptr<CXString> m_ssPrefix;
	xshared_ptr<XamlNamespace> m_spTypeNamespace;
	enum XamlScannerNode::ScannerNodeType m_NodeType;
	XBOOL m_bIsEmptyTag;
	XamlLineInfo m_LineInfo;
};


